package com.pda.yuanjing.thread;

import java.util.ArrayList;
import java.util.List;

public class CodeBeans {
    private List<Code> codes = new ArrayList<>();

    public List<Code> getCodes() {
        return codes;
    }

    public void setCodes(List<Code> codes) {
        this.codes = codes;
    }

    public  int addCode(CodeBeans.Code cbean){
        codes.add(cbean);
        return codes.size();
    }

    public synchronized int removeCode(CodeBeans.Code cbean){
        codes.remove(cbean);
        return codes.size();
    }

    public static class Code  {
        String str ="";
        boolean flag = true;
        boolean flagx = false;

        public String getStr() {
            return str;
        }

        public void setStr(String str) {
            this.str = str;
        }

        public boolean isFlag() {
            return flag;
        }

        public void setFlag(boolean flag) {
            this.flag = flag;
        }

        public boolean isFlagx() {
            return flagx;
        }

        public void setFlagx(boolean flagx) {
            this.flagx = flagx;
        }
    }
}